// 品牌相关API调用 - 与后端BrandController接口保持一致

import request from '@/utils/request'
import type { Brand, BrandPageResponse, BrandQueryParams, BrandCreateRequest, BrandUpdateRequest } from '@/types/brand'

// 新增品牌
export const createBrand = (data: BrandCreateRequest) => {
  return request.post<boolean>('/api/brands', data)
}

// 修改品牌
export const updateBrand = (id: number, data: BrandUpdateRequest) => {
  return request.put<boolean>(`/api/brands/${id}`, data)
}

// 分页查询品牌列表（支持关键字和状态过滤）
export const getBrandList = (params: BrandQueryParams) => {
  return request.get<BrandPageResponse>('/api/brands', { params })
}

// 删除品牌（软删除）
export const deleteBrand = (id: number) => {
  return request.delete<boolean>(`/api/brands/${id}`)
} 